{extend name='admin@public/content'}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">APPID</label>
        <div class="layui-input-inline">
            <input name="authorizer_appid" value="{$Think.get.authorizer_appid|default=''}" placeholder="请输入APPID" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">微信名称</label>
        <div class="layui-input-inline">
            <input name="nick_name" value="{$Think.get.nick_name|default=''}" placeholder="请输入微信名称" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">注册公司</label>
        <div class="layui-input-inline">
            <input name="principal_name" value="{$Think.get.principal_name|default=''}" placeholder="请输入注册公司" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">授权时间</label>
        <div class="layui-input-inline">
            <input id="create_at" name="create_at" value="{$Think.get.create_at|default=''}" placeholder="请选择授权时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>

<script>
    window.laydate.render({range: true, elem: '#create_at'});
</script>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='text-left nowrap' style="width:390px">接口信息</th>
            <th class='text-left nowrap' style="width:120px">服务状态</th>
            <th class='text-left nowrap'>授权绑定时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='text-left nowrap'>
                <div class="inline-block text-top margin-right-5">
                    <img style="width:60px;height:60px" data-tips-text="微信头像" data-tips-image src="{$vo.head_img|default=''}">
                </div>
                <div class="inline-block">
                    公众号AppID：{$vo.authorizer_appid}&nbsp;&nbsp;&nbsp;&nbsp;接口次数：{$vo.total}<br>
                    接口服务密钥：{$vo.appkey|default='<span class="color-desc">未生成接口服务密码, 请稍候授权绑定</span>'}<br>
                    消息推送接口：{$vo.appuri|default='<span class="color-desc">未配置消息推送接口</span>'|raw}
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block text-top margin-right-5">
                    <img onerror="this.src='__STATIC__/theme/img/404_icon.png'" style="width:60px;height:60px" data-tips-text="微信二维码" data-tips-image src="{$vo.qrcode_url|local_image}">
                </div>
                <div class="inline-block">
                    昵称：{$vo.nick_name|default='<span class="color-desc">未获取到公众号昵称</span>'|raw}<br>
                    公司：{$vo.principal_name|default='<span class="color-desc">未获取到公司名字</span>'|raw}<br>
                    状态：{$vo.service_type_info == 2 ? '服务号' : '订阅号'} /
                    {$vo.verify_type_info == -1 ? '未认证' : '<span class="color-green">已认证</span>'} /
                    {if $vo.status eq 0}<span>已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}
                </div>
            </td>

            <td class="text-left nowrap">
                {$vo.create_at|format_datetime|str_replace=' ','<br>',###|raw}
            </td>
            <td class='text-left nowrap'>

                {if $vo.status eq 1 and auth("$classuri/forbid")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}' href="javascript:void(0)">禁用</a>
                {elseif auth("$classuri/resume")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}' href="javascript:void(0)">启用</a>
                {/if}

                {if auth("$classuri/del")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}' href="javascript:void(0)">删除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
{/block}